package com.turing.service.impl;

import com.turing.domain.Company;
import com.turing.mapper.CompanyMapper;
import com.turing.service.ICompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class CompanyServiceImpl implements ICompanyService {

    @Autowired
    private CompanyMapper companyMapper;
    @Override
    public List<Company> selectAll() {
        return companyMapper.selectList();
    }

    @Override
    public Company selectById(Long id) {
        return companyMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertOne(Company company) {
        return companyMapper.insertSelective(company);
    }

    @Override
    public int updateById(Company company) {
        return companyMapper.updateByPrimaryKeySelective(company);
    }

    @Override
    public int deleteByIds(Long[] ids) {
        return companyMapper.deleteByPrimaryKey(ids);
    }
}
